# 函数的嵌套
def func01():
    print("....")
    def func001():
        print("2222")
        return 1

    print("!!!!!")
    res = func001()
    print(res)

def func02():
    print("22222")
    func01()

"""
1!+2!+...10!
10! = 1*2*3*4*5*6*7*8*9*10
1+2+3+4+5+6+7+8+9+10

10!+11!+...20!
"""
def fun1(n):
    res = 1
    i = 1
    while i <= n:
        res = res * i  # res *= i
        i += 1
    return res

def fun2(i,k):
    res01 = 0
    # i = 10
    while i <= k:
        res01 += fun1(i)
        i += 2
    return res01

# def func03():
#     print("...")
#     func03()

# def func04():
#     print(";;;;")
#     func05()
#
# def func05():
#     print("]]]]]]]")
#     func04()
def func06(k):
    if k == 1:
        return 1
    elif k == 2:
        return 1
    else:
        return func06(k-1)+func06(k-2)


def fun_07():
    print("**********")

# fun_07()

if __name__ == '__main__':
    # func01()
    # result = fun2(20,50)
    result = fun2(1,19)
    # print(result)
    # result1 = fun2(15,20)
    # print(result)
    # print(result1)
    # func03()
    # func04()
    # print(func06(5))
    fun_07()
